
var formatDate = require(path.join(__dirname, 'formatDate.js'));

var statusBar = function () {
    this.html = $('<div class="status_bar">Author By DevSpeed &nbsp;&nbsp; <div title="点击进行手动保存">未保存</div></div>');
    this.html.find('div').click(() => {
        this.click();
    });
    this.text = '上次保存时间 : ';
    this.click = function () { };
};
statusBar.prototype = {
    constructor: this,
    render: function () {
        return this.html
    },
    set: function (str) {
        if (str) {
            this.html.find('div').text(this.text + formatDate('-:', str));
        };
    },
    onClick: function (event) {
        this.click = event;
    }
};
module.exports = function () {
    return new statusBar();
};